﻿using System;
using System.Collections.Generic;
using KKSG;
using UnityEngine;
using XMainClient.Tutorial.Command;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	// Token: 0x02000DFB RID: 3579
	internal class XTutorialCmdExecutor
	{
		// Token: 0x0600C16A RID: 49514 RVA: 0x00293260 File Offset: 0x00291460
		public void ExecuteCmd(ref XTutorialCmd Cmd)
		{
			this.ResetRelativeFlag();
			if (this.IsSkip(Cmd))
			{
				if (Cmd.skipParam1 != null && int.Parse(Cmd.skipParam1) != 0)
				{
					XSingleton<XTutorialMgr>.singleton.SkipCurrentTutorial(false);
				}
				else
				{
					Cmd.state = XCmdState.Cmd_Finished;
					XSingleton<XDebug>.singleton.AddLog("Skip Tutorial:" + Cmd.tag, null, null, null, null, null, XDebugColor.XDebug_None);
				}
			}
			else
			{
				XSingleton<XDebug>.singleton.AddLog("XTutorialCmdExecutor.ExecuteCmd ========== cmd:" + Cmd.cmd, null, null, null, null, null);
				if (Cmd.cmd == "forceclick")
				{
					this._command = this._forceCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "forceskill")
				{
					this._command = this._skillCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "noforceclick")
				{
					this._command = this._noforceClickCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "forceslide")
				{
					this._command = this._forceSlideCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "movetutorial")
				{
					this._command = this._moveCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "newsys")
				{
					this._command = this._newIconCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "directsys")
				{
					this._command = this._newDirectSys;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
					XSingleton<XTutorialMgr>.singleton.OnCmdFinished();
				}
				else if (Cmd.cmd == "clickentity")
				{
					this._command = this._clickEntityCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "cutscene")
				{
					this._command = this._cutsceneCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "exec")
				{
					this._command = this._execCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_Finished;
					}
				}
				else if (Cmd.cmd == "puretext")
				{
					this._command = this._pureTextCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "overlay")
				{
					this._command = this._overlayCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "genericclick")
				{
					this._command = this._genericClickCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "showprefab")
				{
					this._command = this._prefabCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "notewindow")
				{
					this._command = this._noteCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
				else if (Cmd.cmd == "hideskills")
				{
					this._command = this._hideskillCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_Finished;
					}
				}
				else if (Cmd.cmd == "showskills")
				{
					this._command = this._showskillCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_Finished;
					}
				}
				else if (Cmd.cmd == "showbutton")
				{
					this._command = this._isshowbuttonCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_Finished;
					}
				}
				else if (Cmd.cmd == "empty")
				{
					this._command = this._emptyCmd;
					this._command.SetCommand(Cmd);
					if (this._command.Execute())
					{
						Cmd.state = XCmdState.Cmd_In_Process;
					}
				}
			}
		}

		// Token: 0x0600C16B RID: 49515 RVA: 0x002938E8 File Offset: 0x00291AE8
		public void UpdateCmd(ref XTutorialCmd Cmd)
		{
			this._command.Update();
			if (this.CanCmdFinish(Cmd))
			{
				XSingleton<XTutorialMgr>.singleton.OnCmdFinished();
			}
		}

		// Token: 0x0600C16C RID: 49516 RVA: 0x0029391B File Offset: 0x00291B1B
		public void StopCmd()
		{
			this._command.Stop();
		}

		// Token: 0x0600C16D RID: 49517 RVA: 0x0029392A File Offset: 0x00291B2A
		public void OnCmdFinish(ref XTutorialCmd Cmd)
		{
			this._command.OnFinish();
			Cmd.state = XCmdState.Cmd_Finished;
			XSingleton<XDebug>.singleton.AddLog("XTutorialCmdExecutor.OnCmdFinish ---------- cmd:" + Cmd.cmd, null, null, null, null, null);
			this._lastCmdFinishTime = Time.time;
		}

		// Token: 0x0600C16E RID: 49518 RVA: 0x0029394C File Offset: 0x00291B4C
		private bool ConditionSatisified(List<XTutorialCmdExecuteCondition> conds, List<string> param)
		{
			bool flag = true;
			for (int i = 0; i < conds.Count; i++)
			{
				switch (conds[i])
				{
				case XTutorialCmdExecuteCondition.Player_Level:
				{
					if ((ulong)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level < (ulong)((long)int.Parse(param[i])))
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.In_Level:
				{
					uint sceneID = XSingleton<XScene>.singleton.SceneID;
					if (sceneID != (uint)int.Parse(param[i]))
					{
						flag = false;
					}
					else
					{
						if (sceneID == 1U)
						{
							if (!DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsVisible())
							{
								flag = false;
							}
						}
					}
					break;
				}
				case XTutorialCmdExecuteCondition.After_Level:
				{
					uint lastFinishScene = XSingleton<XLevelFinishMgr>.singleton.LastFinishScene;
					if (lastFinishScene != (uint)int.Parse(param[i]))
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Cast_Skill:
				{
					if (XSingleton<XEntityMgr>.singleton.Boss == null || !XSingleton<XEntityMgr>.singleton.Boss.Skill.IsCasting() || XSingleton<XEntityMgr>.singleton.Boss.Skill.CurrentSkill.MainCore.ID != XSingleton<XCommon>.singleton.XHash(param[i]))
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.External_String:
				{
					if (!XSingleton<XTutorialMgr>.singleton.QueryExternalString(param[i], false))
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Talk_Npc:
				{
					if (!DlgBase<DramaDlg, DramaDlgBehaviour>.singleton.IsVisible())
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Can_Accept_Task:
				{
					XTaskDocument specificDocument = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
					int num = int.Parse(param[i]);
					bool flag10 = false;
					for (int j = 0; j < specificDocument.TaskRecord.Tasks.Count; j++)
					{
						XTaskInfo xtaskInfo = specificDocument.TaskRecord.Tasks[j];
						if (xtaskInfo != null && (ulong)xtaskInfo.ID == (ulong)((long)num))
						{
							flag10 = true;
							if (xtaskInfo.Status != TaskStatus.TaskStatus_CanTake || !DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsVisible())
							{
								flag = false;
							}
							break;
						}
					}
					if (!flag10)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Can_Finish_Task:
				case XTutorialCmdExecuteCondition.Task_Scene_Finish:
				{
					XTaskDocument specificDocument2 = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
					int num2 = int.Parse(param[i]);
					bool flag14 = false;
					for (int k = 0; k < specificDocument2.TaskRecord.Tasks.Count; k++)
					{
						XTaskInfo xtaskInfo2 = specificDocument2.TaskRecord.Tasks[k];
						if (xtaskInfo2 != null && (ulong)xtaskInfo2.ID == (ulong)((long)num2))
						{
							flag14 = true;
							if (xtaskInfo2.Status != TaskStatus.TaskStatus_Finish || !DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsVisible())
							{
								flag = false;
							}
							break;
						}
					}
					if (!flag14)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Task_Over:
				{
					XTaskDocument specificDocument3 = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
					uint taskid = uint.Parse(param[i]);
					flag = specificDocument3.TaskRecord.IsTaskFinished(taskid);
					break;
				}
				case XTutorialCmdExecuteCondition.Task_Battle:
				{
					XTaskDocument specificDocument4 = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
					uint num3 = uint.Parse(param[i]);
					bool flag18 = false;
					for (int l = 0; l < specificDocument4.TaskRecord.Tasks.Count; l++)
					{
						XTaskInfo xtaskInfo3 = specificDocument4.TaskRecord.Tasks[l];
						TaskTableNew.RowData tableData = xtaskInfo3.TableData;
						uint sceneID2 = XTaskDocument.GetSceneID(ref tableData.PassScene);
						uint sceneID3 = XTaskDocument.GetSceneID(ref tableData.TaskScene);
						if (xtaskInfo3 != null && (sceneID2 == num3 || sceneID3 == num3))
						{
							flag18 = true;
							if (xtaskInfo3.Status != TaskStatus.TaskStatus_Taked || !DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsVisible())
							{
								flag = false;
							}
							break;
						}
					}
					if (!flag18)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Time_Delay:
				{
					float num4 = float.Parse(param[i]);
					if (num4 > 0f && Time.time - this._lastCmdFinishTime < num4)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Sys_Notify:
				{
					bool flag23 = flag;
					if (!XSingleton<XTutorialMgr>.singleton.QueryExternalString("OpenSys" + param[i], false))
					{
						flag = false;
					}
					XPlayerAttributes xplayerData = XSingleton<XAttributeMgr>.singleton.XPlayerData;
					if (xplayerData.IsSystemOpened(uint.Parse(param[i])))
					{
						flag = flag23;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Meet_Enemy:
				{
					if (!XSingleton<XTutorialHelper>.singleton.MeetEnemy)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Art_Skill:
				{
					if (!XSingleton<XTutorialHelper>.singleton.ArtSkillOver)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Cutscene_Over:
				{
					if (XSingleton<XCutScene>.singleton.IsPlaying)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Get_Focused:
				{
					if (XSingleton<XEntityMgr>.singleton.Boss == null || !XSingleton<XEntityMgr>.singleton.Boss.Skill.IsCasting())
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.No_SuperAmor:
				{
					XBoss boss = XSingleton<XEntityMgr>.singleton.Boss;
					if (boss == null)
					{
						flag = false;
					}
					else
					{
						List<XBattleEnemyInfo> enemyList = DlgBase<BattleMain, BattleMainBehaviour>.singleton.EnemyInfoHandler.EnemyList;
						double num5 = 0.0;
						if (enemyList.Count > 0)
						{
							num5 = (double)enemyList[0].m_uiSuperArmor.value;
						}
						if (num5 > 0.0)
						{
							flag = false;
						}
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Boss_Exist:
				{
					if (!XSingleton<XTutorialHelper>.singleton.HasBoss)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Enemy_OnGround:
				{
					if (!XSingleton<XTutorialHelper>.singleton.HitDownOnGround)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.No_Promote:
				{
					if (XSingleton<XEntityMgr>.singleton.Player.TypeID >= 10U)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Team2:
				{
					XTeamDocument specificDocument5 = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
					if (!specificDocument5.bInTeam || specificDocument5.MyTeam.members.Count <= 1)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Has_Target:
				{
					if (!XSingleton<XTutorialHelper>.singleton.HasTarget)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.MainUI:
				{
					if (XSingleton<UIManager>.singleton.IsUIShowed() || XSingleton<UIManager>.singleton.IsHideTutorial())
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Has_Item:
				{
					string[] array = param[i].Split(XGlobalConfig.SequenceSeparator);
					int num6 = int.Parse(array[0]);
					int num7 = int.Parse(array[1]);
					num6 = XBagDocument.ConvertTemplate(num6);
					XBagDocument specificDocument6 = XDocuments.GetSpecificDocument<XBagDocument>(XBagDocument.uuID);
					int num8 = (int)specificDocument6.GetItemCount(num6);
					XFashionDocument specificDocument7 = XDocuments.GetSpecificDocument<XFashionDocument>(XFashionDocument.uuID);
					if (specificDocument7.OwnFashion(num6))
					{
						num8++;
					}
					if (num8 < num7)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Has_Body:
				{
					XBagDocument specificDocument8 = XDocuments.GetSpecificDocument<XBagDocument>(XBagDocument.uuID);
					XItem xitem = null;
					string[] array2 = param[i].Split(XGlobalConfig.SequenceSeparator);
					string a = array2[0];
					int num9 = 0;
					if (array2.Length > 1)
					{
						num9 = int.Parse(array2[1]);
					}
					XJadeDocument specificDocument9 = XDocuments.GetSpecificDocument<XJadeDocument>(XJadeDocument.uuID);
					int num10 = 0;
					if (a == "boots")
					{
						num10 = XBagDocument.BodyPosition<EquipPosition>(EquipPosition.Boots);
						xitem = specificDocument8.EquipBag[num10];
					}
					else
					{
						if (a == "earrings")
						{
							num10 = XBagDocument.BodyPosition<EquipPosition>(EquipPosition.Earrings);
							xitem = specificDocument8.EquipBag[num10];
						}
						else
						{
							if (a == "gloves")
							{
								num10 = XBagDocument.BodyPosition<EquipPosition>(EquipPosition.Gloves);
								xitem = specificDocument8.EquipBag[num10];
							}
							else
							{
								if (a == "headgear")
								{
									num10 = XBagDocument.BodyPosition<EquipPosition>(EquipPosition.EQUIP_START);
									xitem = specificDocument8.EquipBag[num10];
								}
								else
								{
									if (a == "lowerbody")
									{
										num10 = XBagDocument.BodyPosition<EquipPosition>(EquipPosition.Lowerbody);
										xitem = specificDocument8.EquipBag[num10];
									}
									else
									{
										if (a == "mainweapon")
										{
											num10 = XBagDocument.BodyPosition<EquipPosition>(EquipPosition.Mainweapon);
											xitem = specificDocument8.EquipBag[num10];
										}
										else
										{
											if (a == "necklace")
											{
												num10 = XBagDocument.BodyPosition<EquipPosition>(EquipPosition.Necklace);
												xitem = specificDocument8.EquipBag[num10];
											}
											else
											{
												if (a == "rings")
												{
													num10 = XBagDocument.BodyPosition<EquipPosition>(EquipPosition.Rings);
													xitem = specificDocument8.EquipBag[num10];
												}
												else
												{
													if (a == "secondaryweapon")
													{
														num10 = XBagDocument.BodyPosition<EquipPosition>(EquipPosition.Secondaryweapon);
														xitem = specificDocument8.EquipBag[num10];
													}
													else
													{
														if (a == "upperbody")
														{
															num10 = XBagDocument.BodyPosition<EquipPosition>(EquipPosition.Upperbody);
															xitem = specificDocument8.EquipBag[num10];
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
					if (num9 == 0)
					{
						if (xitem == null || xitem.itemID == 0)
						{
							flag = false;
						}
					}
					else
					{
						if (!specificDocument9.HasRedPoint(num10))
						{
							flag = false;
						}
					}
					break;
				}
				case XTutorialCmdExecuteCondition.No_Stackui:
				{
					if (XSingleton<UIManager>.singleton.IsUIShowed() || XSingleton<UIManager>.singleton.IsHideTutorial())
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Activity_Open:
				{
					if (!XSingleton<XTutorialHelper>.singleton.ActivityOpen)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Dragon_Crusade_Open:
				{
					if (!XSingleton<XTutorialHelper>.singleton.DragonCrusadeOpen)
					{
						flag = false;
					}
					break;
				}
				case XTutorialCmdExecuteCondition.Battle_NPC_Talk_End:
				{
					if (!XSingleton<XTutorialHelper>.singleton.BattleNPCTalkEnd)
					{
						flag = false;
					}
					break;
				}
				}
				if (!flag)
				{
					break;
				}
			}
			return flag;
		}

		// Token: 0x0600C16F RID: 49519 RVA: 0x002943D0 File Offset: 0x002925D0
		public bool CanTutorialExecute(XTutorialMainCmd tutorial)
		{
			return this.ConditionSatisified(tutorial.conditions, tutorial.condParams);
		}

		// Token: 0x0600C170 RID: 49520 RVA: 0x002943F8 File Offset: 0x002925F8
		public bool CanCmdExecute(XTutorialCmd cmd)
		{
			if (cmd.state == XCmdState.Cmd_In_Process || cmd.state == XCmdState.Cmd_Finished)
			{
				return false;
			}
			else if (this.ConditionSatisified(cmd.conditions, cmd.condParams))
			{
				for (int i = 0; i < cmd.conditions.Count; i++)
				{
					XTutorialCmdExecuteCondition xtutorialCmdExecuteCondition = cmd.conditions[i];
					if (xtutorialCmdExecuteCondition != XTutorialCmdExecuteCondition.External_String)
					{
						if (xtutorialCmdExecuteCondition == XTutorialCmdExecuteCondition.Sys_Notify)
						{
							XSingleton<XTutorialMgr>.singleton.QueryExternalString("OpenSys" + cmd.condParams[i], true);
						}
					}
					else
					{
						XSingleton<XTutorialMgr>.singleton.QueryExternalString(cmd.condParams[i], true);
					}
				}
				return true;
			}
			else
			{
				return false;
			}
		}

		// Token: 0x0600C171 RID: 49521 RVA: 0x002944CC File Offset: 0x002926CC
		public bool CanCmdFinish(XTutorialCmd cmd)
		{
			if (cmd.state != XCmdState.Cmd_In_Process)
			{
				return false;
			}
			else if (cmd.endcondition == XTutorialCmdFinishCondition.No_Condition)
			{
				return false;
			}
			else
			{
				bool flag3 = false;
				switch (cmd.endcondition)
				{
				case XTutorialCmdFinishCondition.Time:
				{
					float time = Time.time;
					float num = (cmd.endParam.Count > 0) ? float.Parse(cmd.endParam[0]) : 3f;
					if (time - this._command._startTime > num)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.TalkingNpc:
				{
					if (DlgBase<DramaDlg, DramaDlgBehaviour>.singleton.IsVisible())
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.WorldMap:
				{
					if (DlgBase<DungeonSelect, DungeonSelectBehaviour>.singleton.IsVisible())
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.SkillLevelup:
				{
					if (XSingleton<XTutorialHelper>.singleton.SkillLevelup)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.SkillBind:
				{
					if (XSingleton<XTutorialHelper>.singleton.SkillBind)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.UseItem:
				{
					if (XSingleton<XTutorialHelper>.singleton.UseItem)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.SysOpened:
				{
					XPlayerAttributes xplayerData = XSingleton<XAttributeMgr>.singleton.XPlayerData;
					if (xplayerData.IsSystemOpened(uint.Parse(cmd.param1)))
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.GetReward:
				{
					if (XSingleton<XTutorialHelper>.singleton.GetReward)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.Move:
				{
					if (XSingleton<XTutorialHelper>.singleton.Moved)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.ComposeFashion:
				{
					if (XSingleton<XTutorialHelper>.singleton.FashionCompose)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.ReinforceItem:
				{
					if (XSingleton<XTutorialHelper>.singleton.ReinforceItem)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.EnhanceItem:
				{
					if (XSingleton<XTutorialHelper>.singleton.EnhanceItem)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.ChangeProf:
				{
					if (XSingleton<XTutorialHelper>.singleton.SwitchProf)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.HasTeam:
				{
					if (XSingleton<XTutorialHelper>.singleton.HasTeam)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.Smelting:
				{
					if (XSingleton<XTutorialHelper>.singleton.Smelting)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.SelectView:
				{
					if (XSingleton<XTutorialHelper>.singleton.SelectView)
					{
						flag3 = true;
					}
					break;
				}
				case XTutorialCmdFinishCondition.SelectSkipTutorial:
				{
					if (XSingleton<XTutorialHelper>.singleton.SelectSkipTutorial)
					{
						flag3 = true;
					}
					break;
				}
				}
				return flag3;
			}
		}

		// Token: 0x0600C172 RID: 49522 RVA: 0x00294784 File Offset: 0x00292984
		private bool IsSkip(XTutorialCmd cmd)
		{
			string skipCondition = cmd.skipCondition;
			if (string.IsNullOrEmpty(skipCondition))
			{
				return false;
			}
            XSkillTreeDocument specificDocument = XDocuments.GetSpecificDocument<XSkillTreeDocument>(XSkillTreeDocument.uuID);
            bool flag2 = false;
            string text = skipCondition;
            uint num = PrivateImplementationDetails.ComputeStringHash(text);
            if (num <= 2100011009U)
            {
                if (num <= 985216048U)
                {
                    if (num != 153474289U)
                    {
                        if (num != 461464819U)
                        {
                            if (num == 985216048U)
                            {
                                if (text == "MenuBtnInState2")
                                {
                                    flag2 = !DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.MenuSwitchBtnState;
                                }
                            }
                        }
                        else if (text == "ModalDlg")
                        {
                            flag2 = !DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.IsVisible();
                        }
                    }
                    else if (text == "NoLearnSkill")
                    {
                        if (cmd.skipParam2 == null || cmd.skipParam3 == null)
                        {
                            XSingleton<XDebug>.singleton.AddErrorLog(string.Concat(new object[]
                            {
                            "TutorialId:",
                            cmd.TutorialID,
                            " Error\ntag:",
                            cmd.tag,
                            " Command:LearnSkill  Param Num Error"
                            }), null, null, null, null, null);
                        }
                        flag2 = specificDocument.isTutorialNeed(int.Parse(cmd.skipParam2), int.Parse(cmd.skipParam3));
                    }
                }
                else if (num <= 2057789062U)
                {
                    if (num != 1035548905U)
                    {
                        if (num == 2057789062U)
                        {
                            if (text == "LearnSkill")
                            {
                                if (cmd.skipParam2 == null || cmd.skipParam3 == null)
                                {
                                    XSingleton<XDebug>.singleton.AddErrorLog(string.Concat(new object[]
                                    {
                                    "TutorialId:",
                                    cmd.TutorialID,
                                    " Error\ntag:",
                                    cmd.tag,
                                    " Command:LearnSkill  Param Num Error"
                                    }), null, null, null, null, null);
                                }
                                flag2 = !specificDocument.isTutorialNeed(int.Parse(cmd.skipParam2), int.Parse(cmd.skipParam3));
                            }
                        }
                    }
                    else if (text == "MenuBtnInState1")
                    {
                        flag2 = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.MenuSwitchBtnState;
                    }
                }
                else if (num != 2090134647U)
                {
                    if (num == 2100011009U)
                    {
                        if (text == "HasTaskTab")
                        {
                            flag2 = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._TaskNaviHandler._TaskSwitchBtnState;
                        }
                    }
                }
                else if (text == "SelectSight2.5D")
                {
                    XOptionsDocument specificDocument2 = XDocuments.GetSpecificDocument<XOptionsDocument>(XOptionsDocument.uuID);
                    flag2 = (specificDocument2.GetValue(XOptionsDefine.OD_VIEW) == XFastEnumIntEqualityComparer<XOperationMode>.ToInt(XOperationMode.X25D));
                }
            }
            else if (num <= 2995591070U)
            {
                if (num != 2352948218U)
                {
                    if (num != 2805484350U)
                    {
                        if (num == 2995591070U)
                        {
                            if (text == "InTeamTab")
                            {
                                flag2 = !DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._TaskNaviHandler.IsShowingTaskTab;
                            }
                        }
                    }
                    else if (text == "PPTLess")
                    {
                        if (cmd.skipParam2 == null)
                        {
                            XSingleton<XDebug>.singleton.AddErrorLog(string.Concat(new object[]
                            {
                            "TutorialId:",
                            cmd.TutorialID,
                            " Error\ntag:",
                            cmd.tag,
                            " Command:PPTLess  Param Num Error"
                            }), null, null, null, null, null);
                        }
                        flag2 = (XSingleton<XAttributeMgr>.singleton.XPlayerData.GetAttr(XAttributeDefine.XAttr_POWER_POINT_Total) < (double)int.Parse(cmd.skipParam2));
                    }
                }
                else if (text == "InTaskTab")
                {
                    flag2 = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._TaskNaviHandler.IsShowingTaskTab;
                }
            }
            else if (num <= 3972437787U)
            {
                if (num != 3566417125U)
                {
                    if (num == 3972437787U)
                    {
                        if (text == "RadioNoCanOpen")
                        {
                            XRadioDocument specificDocument3 = XDocuments.GetSpecificDocument<XRadioDocument>(XRadioDocument.uuID);
                            XOptionsDocument specificDocument4 = XDocuments.GetSpecificDocument<XOptionsDocument>(XOptionsDocument.uuID);
                            flag2 = (specificDocument3.roomState == XRadioDocument.BigRoomState.InRoom || specificDocument4.GetValue(XOptionsDefine.OD_RADIO) == 0);
                        }
                    }
                }
                else if (text == "CurSkillNoLearn")
                {
                    flag2 = !specificDocument.CheckLevelUpButton();
                }
            }
            else if (num != 4122175948U)
            {
                if (num == 4247367664U)
                {
                    if (text == "Chapter1Star8Box")
                    {
                        flag2 = XSingleton<XStageProgress>.singleton.HasChapterBoxFetched(1, 0);
                    }
                }
            }
            else if (text == "ProfessionNo1Turn")
            {
                flag2 = (XFastEnumIntEqualityComparer<RoleType>.ToInt(XSingleton<XAttributeMgr>.singleton.XPlayerData.Profession) < 10);
            }
            return flag2;
		}

		// Token: 0x0600C173 RID: 49523 RVA: 0x00294C98 File Offset: 0x00292E98
		public void ResetRelativeFlag()
		{
			XSingleton<XTutorialHelper>.singleton.SkillLevelup = false;
			XSingleton<XTutorialHelper>.singleton.SkillBind = false;
			XSingleton<XTutorialHelper>.singleton.UseItem = false;
			XSingleton<XTutorialHelper>.singleton.GetReward = false;
			XSingleton<XTutorialHelper>.singleton.FashionCompose = false;
			XSingleton<XTutorialHelper>.singleton.ReinforceItem = false;
			XSingleton<XTutorialHelper>.singleton.EnhanceItem = false;
			XSingleton<XTutorialHelper>.singleton.SwitchProf = false;
			XSingleton<XTutorialHelper>.singleton.MeetEnemy = false;
			XSingleton<XTutorialHelper>.singleton.HasTeam = false;
			XSingleton<XTutorialHelper>.singleton.Smelting = false;
			XSingleton<XTutorialHelper>.singleton.HitDownOnGround = false;
		}

		// Token: 0x04005189 RID: 20873
		private XBaseCommand _command;

		// Token: 0x0400518A RID: 20874
		public float _lastCmdFinishTime = 0f;

		// Token: 0x0400518B RID: 20875
		private XCommandForceClick _forceCmd = new XCommandForceClick();

		// Token: 0x0400518C RID: 20876
		private XCommandCutscene _cutsceneCmd = new XCommandCutscene();

		// Token: 0x0400518D RID: 20877
		private XCommandExec _execCmd = new XCommandExec();

		// Token: 0x0400518E RID: 20878
		private XCommandForceSlide _forceSlideCmd = new XCommandForceSlide();

		// Token: 0x0400518F RID: 20879
		private XCommandGenericClick _genericClickCmd = new XCommandGenericClick();

		// Token: 0x04005190 RID: 20880
		private XCommandNewIcon _newIconCmd = new XCommandNewIcon();

		// Token: 0x04005191 RID: 20881
		private XCommandDirectSys _newDirectSys = new XCommandDirectSys();

		// Token: 0x04005192 RID: 20882
		private XCommandNoforceClick _noforceClickCmd = new XCommandNoforceClick();

		// Token: 0x04005193 RID: 20883
		private XCommandPureText _pureTextCmd = new XCommandPureText();

		// Token: 0x04005194 RID: 20884
		private XCommandMove _moveCmd = new XCommandMove();

		// Token: 0x04005195 RID: 20885
		private XCommandForceSkill _skillCmd = new XCommandForceSkill();

		// Token: 0x04005196 RID: 20886
		private XCommandPureOverlay _overlayCmd = new XCommandPureOverlay();

		// Token: 0x04005197 RID: 20887
		private XCommandPrefab _prefabCmd = new XCommandPrefab();

		// Token: 0x04005198 RID: 20888
		private XCommandNote _noteCmd = new XCommandNote();

		// Token: 0x04005199 RID: 20889
		private XCommandHideSkills _hideskillCmd = new XCommandHideSkills();

		// Token: 0x0400519A RID: 20890
		private XCommandShowSkills _showskillCmd = new XCommandShowSkills();

		// Token: 0x0400519B RID: 20891
		private XCommandIsShowButton _isshowbuttonCmd = new XCommandIsShowButton();

		// Token: 0x0400519C RID: 20892
		private XCommandClickEntity _clickEntityCmd = new XCommandClickEntity();

		// Token: 0x0400519D RID: 20893
		private XCommandEmpty _emptyCmd = new XCommandEmpty();
	}
}
